home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d20
/
doorskl3.arc
/
DOORSKEL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-01-15
|
38KB
|
979 lines
/**********************************************/
/* */
/* XBBS Door Skeleton -- TC 2.0/MSC 6.0a code */
/* Copyright (c) 1990/91 by M. Kimes */
/* All Rights Reserved */
/* May be freely used for >>>FREE<<< programs */
/* as long as you don't try to save any souls */
/* (nasty habit) */
/* */
/**********************************************/
/* DOORSKEL.H, DOORSKEL's main include file */
/********************************************************/
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* ! ! */
/* !Change the defines in thisproj.h to suit your Door! */
/* ! ! */
/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/********************************************************/
#include "thisproj.h"
/* portability junk */
#ifdef __TURBOC__
#include <dir.h>
#define _fastcall pascal
#define _pascal pascal
#define _cdecl cdecl
#define FAR far
#else
/* actually MSC */
#ifdef DEBUG
#define _fastcall _pascal
#endif
#include <direct.h>
#define MAXDIR 133
#define SH_DENYNONE SH_DENYNO
#define FAR _far
struct time {
unsigned char ti_min;
unsigned char ti_hour;
unsigned char ti_hund;
unsigned char ti_sec;
};
struct date {
int da_year;
char da_day;
char da_mon;
};
#if !defined(MK_FP)
#define MK_FP(seg,off) ((void FAR *)(((long)(seg) << 16) | (unsigned)(off)))
#endif
char *searchpath(char *filename);
#endif
/* standard include files */
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <io.h>
#include <fcntl.h>
#include <dos.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <process.h>
#include <share.h>
#include <stdarg.h>
#include <stddef.h>
#include <conio.h>
/******************************************/
/* some hopefully helpful shortcut macros */
/******************************************/
#define BACKSPACE "\b \b"
#define CSendByte(x) while(!fossil(TRANSMIT,(x)) carrchk()
#define SendByte(x) while(!fossil(TRANSMIT,(x)))
#define MinsLeft ((timelimit - getxbbstime()) / 60L)
#define PurgeOut fossil(PURGEOUT,0)
#define PurgeIn fossil(PURGEIN,0)
#define FlushOut fossil(FLUSHOUT,0)
#define DTROn fossil(DTR,UP)
#define DTROff fossil(DTR,DOWN)
#define ASetPos(x,y) printfm("\x1b[%d;%dH",(x),(y))
#define ASavePos printm("\x1b[s")
#define ARstrPos printm("\x1b[u")
#define IfANSI if(graphics)
#define IfLocal if(baud)
#define printg(s) if(graphics) printm(s)
#define RemoteBell if(baud) while(!fossil(TRANSMIT,('\07')) carrchk();else putchar('\07')
/******************************/
/* typedefs to save on typing */
/******************************/
typedef unsigned int word;
typedef unsigned int bit;
typedef unsigned char byte;
typedef unsigned long ulong;
/*************************************************************************/
/* There's a lot of stuff following specific to XBBS. Don't worry about */
/* taking it out...it might bite you if you do and won't hurt if you */
/* don't... */
/*************************************************************************/
/*------------------------------------------------------*/
/* FIDO Message attributes (attr) */
/*------------------------------------------------------*/
#define MSGPRIVATE 0x0001 /* private message, */
#define MSGCRASH 0x0002 /* accept for forwarding */
#define MSGREAD 0x0004 /* read by addressee */
#define MSGSENT 0x0008 /* sent OK (remote) */
#define MSGFILE 0x0010 /* file attached to msg */
#define MSGFWD 0x0020 /* being forwarded */
#define MSGORPHAN 0x0040 /* unknown dest node */
#define MSGKILL 0x0080 /* kill after mailing */
#define MSGLOCAL 0x0100 /* FidoNet vs. local */
#define MSGXX1 0x0200 /* */
#define MSGXX2 0x0400 /* STRIPPED by FidoNet<tm> */
#define MSGFRQ 0x0800 /* file request */
#define MSGRRQ 0x1000 /* receipt requested */
#define MSGCPT 0x2000 /* is a return receipt */
#define MSGARQ 0x4000 /* audit trail requested */
#define MSGURQ 0x8000 /* update request */
/*------------------------------------------------------*/
/* XBBS Message header */
/*------------------------------------------------------*/
struct _xmsg {
char from[36];
char to[36];
char subj[64];
word o_point;
word length; /* Length of message */
ulong start; /* Starting postition in text file */
char date[20];
word times; /* Number of times read */
word dest; /* Destination node */
word orig; /* Origination node number */
word cost; /* Unit cost charged to send the message */
word orig_net; /* Origination network number */
word dest_net; /* Destination network number */
char indate[4]; /* import date (YMD(null)) */
word m_attr; /* Extra attributes */
word d_zone; /* Destination zone */
word o_zone; /* Origination zone */
word attr; /* Attribute (behavior) of the message */
word d_point;
};
/* These apply to m_attr */
#define MSGDELETED 0x0001 /* deleted message, */
#define MSGANON 0x0002 /* anonymous message */
#define MSGECHO 0x0004 /* unmoved echo message */
#define MSGNET 0x0008 /* unmoved net message */
#define MSGHOLD 0x0010 /* file attached to msg */
#define MSGHOST 0x0020 /* being forwarded */
#define MSGSCANNED 0x0040 /* already scanned */
#define MSGKEEP 0x0080 /* don't delete */
#define MSGTREATED 0x0100 /* soft cr's & lf's removed */
#define MSGPACKED 0x0200 /* message LZSS compressed */
/*
#define 0x0400
#define 0x0800
#define 0x1000 all reserved
#define 0x2000
#define 0x4000
*/
#define MSGTAGGED 0x8000 /* used by offline readers */
/*------------------------------------------------------*/
/* User record structure */
/*------------------------------------------------------*/
struct _user {
char name[36];
char handle[36];
struct date birthdate;
char password[12];
char city[24];
char state[3];
char zip[6];
char phone1[11];
char phone2[11];
bit length: 7;
bit cold: 1;
char width;
bit graphics: 1;
bit fullscreen: 1;
bit scrnclr: 1;
bit commodore: 1;
bit expert: 1;
bit more: 1;
bit ignorehrs: 1;
bit ignorerat: 1;
bit nokill: 1;
bit deleted: 1;
bit arq: 1;
bit twit: 1;
bit ansimenus: 1;
bit gen1: 1;
bit gen2: 1;
bit gen3: 1;
word attr2;
word stat[10];
unsigned long upk;
unsigned long downk;
word upno;
word downno;
word posts;
int credit;
char violations;
struct date lastdate;
struct time lasttime;
struct date logondate;
struct time logontime;
unsigned long times;
word callsperday;
word timepercall;
word totaltime;
word callstoday;
word timetoday;
char variable[5][76]; /* Strings vars saved w/ user record */
word numvars[10]; /* Numeric vars saved w/ user record */
char comptype; /* # designating user's computer type */
word uktoday;
word dktoday;
bit hiok: 1;
bit lastmsgarea: 10;
bit reserved: 5;
word pointid; /* If he's a mailerless point */
unsigned long id;
char node;
};
/*------------------------------------------------------*/
/* User attributes */
/*------------------------------------------------------*/
#define GRAPHICS 0x0001 /* ANSI */
#define FULLSCREEN 0x0002 /* full screen editor */
#define SCRNCLR 0x0004 /* screen clearing? */
#define COMMODORE 0x0008 /* GP Special flag */
#define EXPERT 0x0010 /* help level */
#define MORE 0x0020 /* More? pause */
#define IGNOREHRS 0x0040 /* Ignore u/d hours */
#define IGNORERAT 0x0080 /* Ignore ratio enforcement */
#define NOKILL 0x0100 /* Don't kill user */
#define DELETED 0x0200 /* User is deleted */
#define ARQ 0x0400 /* Reliable connect */
#define TWIT 0x0800 /* Twit or whatever */
#define ANSIMENUS 0x1000 /* Use ANSI Menus? */
#define GEN1 0x2000 /* No use by system */
#define GEN2 0x4000 /* No use by system */
#define GEN3 0x8000 /* No use by system */
/*-----------------------------------*/
/* Message area record */
/*-----------------------------------*/
struct _mboard {
char name[48];
char forceto[36];
word attr; /* will become long next release of XBBS */
word max;
word number;
word substat1;
word substat2;
signed char age;
word flags;
word minwrite;
};
/*------------------------------------------------------*/
/* MBoard attributes */
/*------------------------------------------------------*/
#define NOORIG 0x00000001 /* No Origin or tear */
#define ANSI 0x00000002 /* ANSI */
#define PRIVATE 0x00000004 /* Obvious */
#define PUBLIC 0x00000008 /* " */
#define ECHO 0x00000010 /* " */
#define NET 0x00000020 /* " */
#define MCI 0x00000040 /* " */
#define READONLY 0x00000080 /* " */
#define ALTERNATE 0x00000100 /* " */
#define ALTECHO 0x00000200 /* " */
#define ANON 0x00000400 /* " */
#define REAL 0x00000800 /* " */
#define ASSOC 0x00001000 /* Msg area allows assoc */
#define EXTERN 0x00002000 /* Activates [E] prompt */
#define FORCE 0x00004000 /* Always force */
#define COMPRESS 0x00008000 /* Allow LZSS comp here */
#define GROUPMAIL 0x00010000 /* Group mail conference */
#define USENET 0x00020000 /* usenet conference */
/*---------------------------------------------------*/
/* FBoard flags */
/*---------------------------------------------------*/
#define COUNTDLS 0x0001 /* Use timestamp as #dls */
#define FREEFILES 0x0002 /* Don't inc downloads */
#define FILEASSOC 0x0004 /* File area allows assoc */
#define FREEUP 0x0008 /* Don't inc uploads */
/*---------------------------------------------------*/
/* File area record */
/*---------------------------------------------------*/
struct _fboard {
char name[47];
char flags;
char dpath[79];
char upath[79];
signed char age;
word userflags;
char leechpercent;
};
/* sending this string to the commport aborts most file transfer protocols */
#define STOPDL "\x0b\x03\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18\x18"
/*------------------------------------*/
/* Protocol record */
/*------------------------------------*/
struct protocol {
char name[25];
char key;
int adj;
char spawndn[119];
char spawnup[119];
char abort[48];
unsigned wild: 1;
unsigned multi: 1;
unsigned simul: 1;
unsigned list: 1;
unsigned opus: 1;
unsigned noname: 1;
unsigned reserved: 2;
char pad1;
char pad2;
};
/*----------------------------------------------------*/
/* */
/* CONFIGURATION............. */
/* */
/*----------------------------------------------------*/
struct _config {
char commport; /* Commport to use...0=COM1,1=COM2,etc. */
word node; /* Our node number */
char mailpath[79]; /* Path for incoming messages */
char filepath[79]; /* Path for incoming files */
word net; /* Our network number */
word alt_node; /* Alternate node number (mainly for HOSTS) */
word alt_net; /* Alternate net number (mainly for HOSTS) */
/* Note: these bytes for zones are mistakes; will be corrected next
release of XBBS... */
byte zone; /* Our zone number */
byte alt_zone; /* Alternate zone number */
char homepath[79]; /* Path to BBS Files */
char outpath[79]; /* Path for outbound messages */
char menupath[79]; /* Path to system menu files */
char messpath[79]; /* Path to system message files */
char sysop[36]; /* SysOp's name */
char system[64]; /* BBS's name */
char logfile[79]; /* System logfile */
word idleseconds; /* Seconds user can be idle before disconnect */
char pages; /* Number of times user can page sysop */
bit sysopin: 1; /* Is he? 0 or 1 */
bit touchup: 1; /* Touchup uploaded file dates? 0 or 1 */
bit uptime: 1; /* 1=Return upload time */
bit downtime: 1; /* 1=Return download time */
bit dvideo: 1; /* Use direct video for some output? */
bit bvideo: 1; /* If not, use BIOS? */
bit bioswrites: 1; /* Write through BIOS for ANSI? */
bit debug: 1; /* Debug on or off (0 or 1) */
bit ansiavail: 1; /* Is ANSI available? 0 or 1 */
bit whichstat: 2; /* Default status line (0-2) */
bit promptsay: 1;
char edansi[79]; /* External ANSI editor DOS string */
char edline[79]; /* External line editor DOS string */
char edlocal[79]; /* Local message editor DOS string */
word ansibaud; /* Minimum baud for ANSI */
char quotestring[4]; /* String to put before quotes in reply */
ulong callcount; /* Number of System calls */
char lastcaller[36]; /* Last caller to system */
word netmailboard; /* Net Mail Board # */
word altnetboard; /* Net Mail Board # for alternate zone:net/node */
struct _mboard mboard; /* Default message board setup */
struct _fboard fboard; /* Default file board setup */
char origin[59]; /* Default origin line */
char carbons; /* Number of carbons allowed */
char jumpfile[10][13]; /* Jump filenames */
char jumpkey[10][2]; /* Jump keys */
char subfile[10][13];/* Sub filenames */
char subkey[10][2]; /* Sub keys */
word nolmrs;
long quote_pos; /* Start of next sequential quote in quotefile */
char quote_file[13]; /* Name of quotefile */
char domain[37];
char alt_domain[37];
bit forcefilemsg: 1;
bit trace: 1;
bit RBBSorQBBS: 1; /* Type of DORINFO?.DEF to make */
bit reservedbits: 5;
ulong nextid;
word packsize;
char helpkey;
int version;
long lastcall;
char reserved1[94]; /* */
char startat; /* Start u/d enforcement after # d/l's */
char numcomps; /* How many computer types you are tracking */
char edgraph[79]; /* "Real" ANSI editor */
char comments; /* Number of comment lines for upload */
word purgebaud; /* Maximum baud rate to purge outbound with */
bit genphone: 1; /* Use generic phone input? */
bit genstatezip: 1; /* Use state & zip as generic field? */
bit share: 1; /* Using SHARE.EXE? */
bit fastANSI: 1; /* Use INT 29h for ANSI output? */
bit logmenu: 1;
bit logfiles: 1;
bit logmsg: 1;
bit logtext: 1;
char nodelist[79]; /* Path to nodelist files */
word lastusernum; /* Last user's record # */
char useswapdisk; /* Disk drive to use for swapping */
char LIMEMS; /* Use LIMEMS for swapping? */
char swap; /* Swap or not? */
int available[41]; /* For third party apps...see notes */
char reserved2;
};
/*
Notes on available[] area in _config structure. These ints may be
allocated by a third-party program so long as the app first makes
sure the int is not 0! Apps should always use the highest
available slot. Do not use a slot unless it (the two-byte int) is
0! Even XBBS might use a slot someday following this convention,
so you'll avoid system crashes someday if you play by the rules
today.
*/
#ifdef NEXT_XVERSION
/* the next version of XBBS (1.18) will have the following config format
to correct the long-standing oversight of zones being limited to
1-255 */
struct _config {
char commport; /* Commport to use...0=COM1,1=COM2,etc. */
word node; /* Our node number */
char mailpath[79]; /* Path for incoming messages */
char filepath[79]; /* Path for incoming files */
word net; /* Our network number */
word alt_node; /* Alternate node number (mainly for HOSTS) */
word alt_net; /* Alternate net number (mainly for HOSTS) */
word alt_zone; /* Alternate zone number */
char homepath[79]; /* Path to BBS Files */
char outpath[79]; /* Path for outbound messages */
char menupath[79]; /* Path to system menu files */
char messpath[79]; /* Path to system message files */
char sysop[36]; /* SysOp's name */
char system[64]; /* BBS's name */
char logfile[79]; /* System logfile */
word idleseconds; /* Seconds user can be idle before disconnect */
char pages; /* Number of times user can page sysop */
bit sysopin: 1; /* Is he? 0 or 1 */
bit touchup: 1; /* Touchup uploaded file dates? 0 or 1 */
bit uptime: 1; /* 1=Return upload time */
bit downtime: 1; /* 1=Return download time */
bit dvideo: 1; /* Use direct video for some output? */
bit bvideo: 1; /* If not, use BIOS? */
bit bioswrites: 1; /* Write through BIOS for ANSI? */
bit debug: 1; /* Debug on or off (0 or 1) */
bit ansiavail: 1; /* Is ANSI available? 0 or 1 */
bit whichstat: 2; /* Default status line (0-2) */
bit promptsay: 1;
char edansi[79]; /* External ANSI editor DOS string */
char edline[79]; /* External line editor DOS string */
char edlocal[79]; /* Local message editor DOS string */
word ansibaud; /* Minimum baud for ANSI */
char quotestring[4]; /* String to put before quotes in reply */
ulong callcount; /* Number of System calls */
char lastcaller[36]; /* Last caller to system */
word netmailboard; /* Net Mail Board # */
word altnetboard; /* Net Mail Board # for alternate zone:net/node */
struct _mboard mboard; /* Default message board setup */
struct _fboard fboard; /* Default file board setup */
char origin[59]; /* Default origin line */
char carbons; /* Number of carbons allowed */
char jumpfile[10][13]; /* Jump filenames */
char jumpkey[10][2]; /* Jump keys */
char subfile[10][13];/* Sub filenames */
char subkey[10][2]; /* Sub keys */
word nolmrs;
long quote_pos; /* Start of next sequential quote in quotefile */
char quote_file[13]; /* Name of quotefile */
char domain[37];
char alt_domain[37];
bit forcefilemsg: 1;
bit trace: 1;
bit RBBSorQBBS: 1; /* Type of DORINFO?.DEF to make */
bit reservedbits: 5;
ulong nextid;
word packsize;
char helpkey;
int version;
long lastcall;
word zone;
char reserved1[92]; /* */
char startat; /* Start u/d enforcement after # d/l's */
char numcomps; /* How many computer types you are tracking */
char edgraph[79]; /* "Real" ANSI editor */
char comments; /* Number of comment lines for upload */
word purgebaud; /* Maximum baud rate to purge outbound with */
bit genphone: 1; /* Use generic phone input? */
bit genstatezip: 1; /* Use state & zip as generic field? */
bit share: 1; /* Using SHARE.EXE? */
bit fastANSI: 1; /* Use INT 29h for ANSI output? */
bit logmenu: 1;
bit logfiles: 1;
bit logmsg: 1;
bit logtext: 1;
char nodelist[79]; /* Path to nodelist files */
word lastusernum; /* Last user's record # */
char useswapdisk; /* Disk drive to use for swapping */
char LIMEMS; /* Use LIMEMS for swapping? */
char swap; /* Swap or not? */
int available[41]; /* For third party apps...see notes */
char reserved2;
};
#endif
/*-------------------------------------------------------*/
/* Logon Configuration */
/*-------------------------------------------------------*/
struct _logconfig {
bit name;
bit handle;
bit phone1;
bit phone2;
bit graphics;
bit ansiedit;
bit scrnclr;
bit pagepause;
bit commflag;
bit zipcode;
bit city;
bit state;
bit pass;
bit birth;
bit length;
bit width;
bit locallog; /* Automatic logon in local mode? */
char loglimit; /* How long to give user for login (mins) */
char nameattempts; /* How many times user can try to enter name */
char passattempts; /* How many times user can try to enter pword */
word minbaud; /* Minimum baud rate */
char reserved[24];
};
struct _events { /* Structure for XBBS online events */
char filename[13];
ulong secsleft;
};
/************************ End of XBBS junk *****************************/
/*================================================================*/
/* FOSSIL definitions...just call int 14h (see function fossil()) */
/*================================================================*/
#define SETBAUD 0
#define TRANSWAIT 1
#define RECVWAIT 2
#define GETSTAT 3
#define INIT 4
#define DEINIT 5
#define DTR 6
#define UP 1
#define DOWN 0
#define FLUSHOUT 8
#define PURGEOUT 9
#define PURGEIN 10
#define TRANSMIT 11
#define PEEK 12
#define KEYNOWAIT 13
#define KEYWAIT 14
#define FLOW 15
#define ONOFF 16
#define ON 0
#define OFF 2
#define SETCRSR 17
#define READCRSR 18
#define ONEANSI 19
#define CARRIER 128
#define INITOK 0x1954
#define WATCHDOG 20
#define REBOOT 23
#define COLD 0
#define WARM 1
#define BLOCKREAD 24
#define BLOCKWRITE 25
/***************************************************************************/
/* Symbols for genin()...don't think all are valid in this implementation. */
/* Check the code. */
/***************************************************************************/
#define ALLL 1
#define ALPHA 2
#define NUM 3
#define ALPHANUM 4
#define YESNO 5
#define FLE 6
#define FLEP 7
#define FLEW 8
#define FLEPW 9
#define NAME 10
#define NEAT 11
#define PHONE 12
#define DATE 13
#define SUBJECT 14
#define YESNOM 15
#define FLEX 16
#define ARROWS 17
#define ANSIIN 18
#define ANSISET 19
#define FBATCH 20
#define FBATCHW 21
#define FBATCHWP 22
#define FBATCHP 23
#define TRUEANSI 24
#define WORD 25
#define WORDNUM 26
#define BITS 27
#define ANY 28
#define ANYNOECHO 29
#define HYPER 30
#define THRU 31
#define FLENX 64
#define YESNOQ 65
/**************************************************************************/
/* Macros for implementing simple timers. All timers use 1000ths of */
/* a second, but are only 'accurate' to one clock tick. Typical example */
/* of use (a one second timer): */
/* */
/* clock_t t1; */
/* */
/* t1 = timerset(1000L); */
/* while(!timeup(t1)) { */
/* ...do something... */
/* pause_mtask(); // give up time slice */
/* } */
/**************************************************************************/
#ifdef __TURBOC__
#define CLOCKS_PER_SEC CLK_TCK
#endif
#define timerset(tmt) (((tmt / 1000L) * (clock_t)CLOCKS_PER_SEC) + clock())
#define timeup(tmt) (tmt < clock())
#define timeleft(tmt) (((tmt - clock()) / (clock_t)CLOCKS_PER_SEC) * 1000L)
/*******************************************************/
/* multitasker-cooperation functions in mtask.c */
/* set_mtask() is called in DOORSKEL.C */
/*******************************************************/
void _fastcall set_mtask (void);
void _fastcall pause_mtask (void); /* give up time slice */
void _fastcall my_sleep (int secs);
void _fastcall DosSleep (clock_t millisecs);
/**************************************************************************/
/* The following functions are in jim nutt's pd screen writing library */
/* (called SCREEN2.ASM in the archive. OBJ is provided for those of you */
/* who don't have assemblers). I switched to this from cprintf() because */
/* TC's cprintf() can't handle screen lines below 25. Besides, this is */
/* more flexible. To get dprintf() to work exactly like TC's cprintf(), */
/* get the current cursor position with curr_cursor() just before calling */
/* it (curr_cursor(&x,&y);dprintf(x,y,"Blah & foo...");). Set color of */
/* dprintf() by changing the value of current_color. You can use the */
/* mcolor and/or clr definitions to get a value for it. dcls() clears to */
/* color in cls_clr instead of current_color. */
/* */
/* Note: to cut down some on unneeded overhead, I've hidden several of */
/* the SCREEN2.ASM functions behind #ifdef __SCREEN2ASM__ and included */
/* small C replacements for dputs, dprintf and dputc (all that Doorskel */
/* uses by default). If you want the rest, just #define __SCREEN2ASM__ */
/**************************************************************************/
int _cdecl dprintf(int x,int y,char *string,...);
#ifdef __SCREEN2ASM__
int _pascal FAR dputs(int x, int y, char FAR *s);
void _pascal FAR dcls(void);
void _pascal FAR dputc(int x, int y, int c);
void _pascal FAR dputcx(int x,int y,char attr,char c);
int _pascal FAR dputsx(int x,int y,char attr,char FAR *s);
void _pascal FAR dclrwnd(int x1, int y1, int x2, int y2);
void _pascal FAR dscrollup(int x1, int y1, int x2, int y2);
void _pascal FAR dscrolldn(int x1, int y1, int x2, int y2);
#else
#define dputc(x,y,c) *(vseg + ((((y) - 1) * maxx) + ((x) - 1))) = \
((c) | (current_color << 8));
int _pascal dputs(int x, int y, char *s);
#endif
extern char cls_clr; /* color for clear screen operations like dcls() */
extern char current_color; /* current color for pd screen writing funcs */
extern word videomethod; /* video method for pd screen writing funcs (0=direct) */
extern word vbase; /* video base RAM location set by vmode() */
/* macros to make it easy to define colors for cls_clr and current_color */
#define mcolor(fg,bg) ((fg & 15) | ((bg & 7) << 4))
#define clr(bg,fg,in) ((fg) | (bg << 4) | (in))
/************************************/
/* functions in doormisc.c */
/************************************/
unsigned char *_fastcall addtolog(unsigned char *text);
void _fastcall cursor(int x,int y);
void _fastcall curr_cursor(int *x,int *y);
unsigned char *_fastcall stristr(unsigned char *t,unsigned char *s);
unsigned char *_fastcall stripcr(unsigned char *a);
unsigned char *_fastcall lstrip(unsigned char *a);
unsigned char *_fastcall rstrip(unsigned char *a);
unsigned char _fastcall spawnit(unsigned char *strr);
void _fastcall set_screen_size(void);
void _fastcall set_cooked(void);
void _fastcall set_raw(void);
int _fastcall vmode(void);
/************************************/
/* functions in doorskel.c */
/************************************/
void _cdecl main(int argc,unsigned char **argv);
void _fastcall printhelp(void);
void _fastcall chat(void);
unsigned char _fastcall inkey(void);
unsigned char _fastcall specialmod(unsigned char wuz);
unsigned char _fastcall specialkey(unsigned char a);
void _fastcall cls(void);
unsigned char _fastcall fossil(unsigned char function,unsigned char arg);
void _cdecl deinitialize(void);
unsigned char *_fastcall genin(unsigned char length,unsigned char password,
unsigned char caps,unsigned char hot,
unsigned char type);
unsigned char _fastcall carrchk(void);
void _fastcall hitreturn(void);
long _fastcall getxbbstime(void);
void _fastcall printinfo(void);
unsigned char *_fastcall fidodate(void);
int _cdecl printfm(unsigned char *string,...);
void _cdecl aprintf(unsigned char *string,...);
void _cdecl debug_print(unsigned char *string,...);
int _fastcall printm(unsigned char *text);
void _fastcall mprint(unsigned char *text);
void _fastcall print_stat(void);
/************************************/
/* functions in doorskl4.c */
/************************************/
void _fastcall mainloop (void); /* where your coding begins... */
/************************************/
/* functions in ansi.asm */
/************************************/
int _pascal FAR ansi (char FAR *str);
void _pascal FAR setcoords (int topx,int topy,int botx,int boty);
void _pascal FAR getcoords (int FAR *topx,int FAR *topy,
int FAR *botx,int FAR *boty);
void _pascal FAR setfastansi(int fast);
/************************************/
/* functions in optional doorskl5.c */
/************************************/
int _pascal calcrc (char *ptrr, int count, int likexmodem); /* 16 bit */
long _fastcall crc32blk (char *str,int blklen); /* 32 bit */
long _fastcall crc32str(char *str);
/************************************/
/* functions in optional doorhelp.c */
/************************************/
void _fastcall load_help (char *hn);
void _fastcall set_help (char *topic);
void _fastcall help (void);
/************************************/
/* functions in optional dooransi.c */
/************************************/
char _fastcall ansimenu2 (char tcolor,char color,char *title,
char *lineorig,char variable[10][133]);
char _fastcall ansimenu (char color, char *lineorig);
/************************************/
/* functions in optional select1.c */
/************************************/
int _fastcall select_one (char **selections,int numselecs,char *prompt,
unsigned int flags);
int _fastcall is_one (int key,char **selections,int numselecs);
int _fastcall top_menu (char **selections,int numselects);
void _fastcall backup (int num);
#define backup_string(s) backup(strlen(s) + 1)
/************************************/
/* conditionally compiled functions */
/* (mostly in doorskl2 and doorskl3 */
/************************************/
#ifdef XBBS
void _fastcall getonline(void);
void _fastcall readconfig(void);
void _fastcall prepare(void);
void _fastcall saveconfig(void);
#endif
#ifndef NOREADFILE
char _fastcall readtext(char *,char);
char * _fastcall write_line (char **text,word linelen);
void _fastcall strip_blanklines (char *hold);
#endif
#ifdef FINDUSER
word _fastcall finduser (char *users_name,struct _user *other);
#endif
#ifdef DORINFO
void _fastcall readinfo(void);
#endif
#ifdef DIALTRANS
int _fastcall dial_trans (char *str); /* in doormisc */
int _fastcall recvbyte (void);
int _fastcall is_carrier (void);
char * _fastcall get_modemstring (clock_t timer);
#endif
#ifdef DISABLEBREAK
void _cdecl break_handler (int sigl); /* in doorskel */
#endif
/***************************************/
/* global variable extern declarations */
/***************************************/
/* conditional globals */
#ifdef XBBS
extern struct _config conf;
extern struct _user user;
extern word userno;
extern struct time timeon;
extern char timer_off;
extern word hold_time;
extern char age;
extern char pages;
extern struct _mboard mboard;
extern struct _fboard fboard;
extern struct _events event[10];
extern char variable[10][82];
extern ulong starter;
#endif
/* globals always used */
extern char debug_mode;
extern char graphics;
extern time_t timelimit;
extern word baud;
extern char numlines;
extern word seclvl;
extern time_t startt;
extern char sysopin;
extern char fastANSI;
extern char commport;
extern char logfile[133];
extern char username[36];
extern char width;
extern char chatting;
extern char chatted;
extern char nodenumber;
extern char system_name[64];
extern char sysop[36];
extern int maxx,maxy;
extern int FAR *vseg;
/* END OF FILE: doorskel.h */